package game.views;

import game.shader.CosQuickShader;
import game.shader.CosShader;
import hx.display.ItemRenderer;
import hx.display.Box;

/**
 * 角色系列按钮
 */
@:build(hx.macro.UIBuilder.build("assets/views/RoleGroupButton.xml"))
class RoleGroupButton extends ItemRenderer {
	override function onInit() {
		super.onInit();
		this.bg.alpha = 0;
		this.line_selected.visible = false;
		this.line_selected.shader = CosQuickShader.getInstance();
	}

	/**
	 * 设置角色系列的数据渲染
	 * @param text 
	 * @param isSelected 
	 */
	override public function setData(data:Dynamic):Void {
		this.nameLabel.data = data.name;
	}

	override function setSelected(selected:Bool) {
		this.line_selected.visible = selected;
		super.setSelected(selected);
	}

	public function setGroupLight(isLight:Bool) {
		this.light.visible = isLight;
	}
}
